<template>
  <div class="ChildPage TablePage" v-loading="loading">
    <vb-page ref="page">
      <template #headerSearch-btn-append="{ searchForm }">
        <el-button type="warning" size="small" icon="el-icon-download" @click="downloadLossRote(searchForm)">下载损耗率</el-button>
      </template>

      <template #table-status="scope">
        <el-tag :type="scope.row.status === 'save'? 'info': (scope.row.status === 'audit'? 'success': 'danger')">{{ scope.row.status === 'save'? '保存': (scope.row.status === 'audit'? '审核': '关闭') }}</el-tag>
      </template>
      <template #table-realityCount="scope">
        {{ scope.row.realityCount? Number(scope.row.realityCount).toFixed(2): scope.row.realityCount }}
      </template>
      <template #table-lossCount="scope">
        {{ scope.row.lossCount? Number(scope.row.lossCount).toFixed(2): scope.row.lossCount }}
      </template>
      <template #table-pickCount="scope">
        {{ scope.row.pickCount? Number(scope.row.pickCount).toFixed(2): scope.row.pickCount }}
      </template>
      <template #table-returnCount="scope">
        {{ scope.row.returnCount? Number(scope.row.returnCount).toFixed(2): scope.row.returnCount }}
      </template>
    </vb-page>
  </div>
</template>

<script>
export default {
  data() {
    return {
      materialLoading: false,
      dataLiat:[],
    }
  },
  async mounted() {
    await this.getStock()
    await this.selectStock()
  },
  methods : {
    async downloadLossRote(searchForm){
      this.loading = true
      try {
        let res = await this.callApi('download_loss_rote_list',searchForm)
        if (!res.res) return
      } finally {
        this.loading = false
      }
    },
    async doDownload(searchForm) {
      this.loading = true
      try {
        let res = await this.callApi('download_material_summary', searchForm)
        if (!res.res) return
      } finally {
        this.loading = false
      }
    },


  }
}
</script>

<style scoped>
</style>